package com.library.xtype;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import com.library.xtype.NuwaGroupRecyclerViewAdapter.BinderGroup;

/**
 * 在此写用途
 *
 * @author: zhiwei
 * @date: 2017-03-21 10:37
 * @version: 9.1.0
 */
public class WrapRecyclerViewHolder<T > extends RecyclerView.ViewHolder implements INuwaLifecycle {
    private INuwaItemBinder<T> mNuwaItemView;

    public WrapRecyclerViewHolder(View itemView, INuwaItemBinder<T> nuwaItemView) {
        super(itemView);
        mNuwaItemView = nuwaItemView;
    }

    public void onBindView(int position, BinderGroup<T> binderGroup) {
        mNuwaItemView.onBindView(position, itemView, (ViewGroup) itemView.getParent(), binderGroup);
    }

    public void onBindView(int position, T nuwaItemVo) {
        mNuwaItemView.onBindView(position, itemView, (ViewGroup) itemView.getParent(), nuwaItemVo);
    }

    public INuwaItemBinder<T> getNuwaItemView() {
        return mNuwaItemView;
    }

    @Override
    public void onCreate() {
        mNuwaItemView.onCreate();
    }

    @Override
    public void onStart() {
        mNuwaItemView.onStart();
    }

    @Override
    public void onResume() {
        mNuwaItemView.onResume();
    }

    @Override
    public void onPause() {
        mNuwaItemView.onPause();
    }

    @Override
    public void onStop() {
        mNuwaItemView.onStop();
    }

    @Override
    public void onDestroy() {
        mNuwaItemView.onDestroy();
    }
}
